package com.yiyi.credit.manage.abutment.common.enums;


public enum ProductType {

    BLEND_PRODUCT(1, "集合标产品"),
    COMMON_PRODUCT(2, "散标产品");


    private final int key;


    private final String value;

    ProductType(int key, String value) {
        this.key = key;
        this.value = value;
    }

    public static ProductType getEnumByKey(int key) {
        for (ProductType item : ProductType.values()) {
            if (item.getKey() == key) {
                return item;
            }
        }
        throw new RuntimeException(String.format("主站产品类型不存在:{%s}", key));
    }

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
